//
//  SCLocation.swift
//  SwiftCommon
//
//  Created by lijl on 15/6/15.
//  Copyright (c) 2015年 lijialong. All rights reserved.
//

import Foundation
import CoreLocation


public class SCLocation{


    /**
    设备的定位功能是否打开了
    
    :returns: <#return value description#>
    */
    public class func isEnable() -> Bool{
        return CLLocationManager.locationServicesEnabled()
    }
    
    /**
    当前定位功能的状态，即用户是否允许了，还是拒绝了
    
    :returns: <#return value description#>
    */
    public class func getAuthStatu() -> CLAuthorizationStatus{
        return CLLocationManager.authorizationStatus()
    }
    
    /**
    根据CLLocation获取真实地址
    
    :param: locationInfo 包含经纬度信息的CLLocation
    :param: handler      回调方法
    */
    public class func getGeocodeLocation(locationInfo:CLLocation,handler: CLGeocodeCompletionHandler!){
        var ge:CLGeocoder = CLGeocoder()
        ge.reverseGeocodeLocation(locationInfo, completionHandler: handler)
    }
    
}